<!-- Sofija Puric 6/08 -->
<?php
require '../pages/db.php';
$con = dbConnect("sib");

$result=mysql_query('SELECT * FROM event');
if (!$result) {
    echo ("<p>Error performing query: " . mysql_error() . " </p>");
    exit();
}
echo '<div class="admin-events">
    <div class="admin-title">
        <h2>Events</h2>
        <h4><a href="event-add.php">Add Event</a></h4>
    </div>

    <div class="admin-content">
        <table border="0" align="center">
            <thead>
                <tr>
                    <th>Event ID</th>
                    <th>Name</th>
                    <th>Edit</th>
                    <th>Delete</th>
                </tr>
            </thead>';
while ( $row = mysql_fetch_array($result) )  {
    echo ('<tr>
                    <td>' . $row["IDEvent"] . '</td>' .
                    '<td>' . $row["Name"] . '</td>' .
                    '<td> <a href="event-e.php?eventid='. $row["IDEvent"].'" >Edit</a></td>' .
                    '<td><a href="event-d.php?eventid='. $row["IDEvent"].'">Delete</a></td>
         </tr>');
                
        }
echo '</table>

    </div>
</div>';
mysql_close($con);

?>

                    